<?php
/**
 * - auto include according Object class
 * @since 1.0 - 06-05-2009
 * @author Nguyen Thanh Quyen
 */
function __autoload($class)
{
    include_once($class . '.class.php');
}

/**
 * Criteria
 * - Object help to create Object Criteria_xxx
 * @author Nguyen Thanh Quyen
 * @since 1.0 - 06-05-2009
 * @copyright Copyright &copy; 2009, RunSystem
 */
 class Criteria {
 	public static $criteria;
 	/**
 	 * factoryCriteria
 	 * - get the Object Criteria
 	 * @author Nguyen Thanh Quyen
 	 * @since 1.0 - 06-05-2009
 	 * @return Object Criteria_xxx
 	 */
 	 public function factoryCriteria(){
 	 	global $dbInfo;
 	 	$database = $dbInfo['database'];
 	 	switch($database){
 	 		case 'mysql':
 	 			self::$criteria = new Criteria_mysql();
 	 			break;
 	 		case 'postgre':
 	 			self::$criteria = new Criteria_postgre();
 	 			break;
 	 		case 'mssql':
 	 			self::$criteria = new Criteria_mssql();
 	 			break;
 	 		default:
 	 			self::$criteria = new Criteria_mysql();
 	 			break;
 	 	}
 	 	return self::$criteria;
 	 }
 }
?>